package com.meilai.project.mapper.finance.supplier;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.meilai.project.dto.finance.supplier.SupplierMaterialListDTO;
import com.meilai.project.entity.finance.supplier.SupplierMaterial;
import com.meilai.project.vo.finance.supplier.SupplierMaterialWebVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SupplierMaterialMapper extends BaseMapper<SupplierMaterial> {

    List<SupplierMaterialWebVO> selectPageList(Page<SupplierMaterialWebVO> page,
                                               @Param("query") SupplierMaterialListDTO query);

    void updateDeletedAtByIds(@Param("ids") List<Long> ids);

    @Select("select id from supplier_material where deleted_at is null and supplier_id=#{supplier_id}")
    List<Long> getIdsBySupplierId(@Param("supplier_id") Long supplier_id);
}
